
package GUI;

import gameStructure.playersChoice;

import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class messageBox extends JFrame{
    
//    public messageBox(){
//        super("Player choice Box");
//        setLayout( new FlowLayout());
//        JLabel Player1 = new JLabel("Player 1:");
//        add(Player1);
//        String [] choices = {"Randrom", "White","Black"};
//        final JComboBox combo = new JComboBox(choices);
//        combo.setMaximumRowCount(3);
//        add(combo);
//        JLabel Player2 = new JLabel("Player 2");
//        add(Player2);
//        
//        String [] pChoice = new String[2]; // pChoice[0] -> Player1, pChoice[1] -> Player2.
//        combo.addItemListener(
//                new ItemListener(){
//            public void itemStateChanged(ItemEvent event) {
//                /**
//                 * TODO tha "kali" ton constractora tis class playersChoice kai tha dini san isodo
//                 * to clr: ton arhiko haraktira tou hromatos pou epilexe o Player1
//                 * kai to name: pou ine ena 1D String me ta onomata ton pethon.
//                 */
//            }
//                    
//                }
//        );
//    }

    public messageBox() {
        
        super("Player choice Box");
        setLayout( new FlowLayout());
        JLabel Player1 = new JLabel("Player 1:");
        add(Player1);
        String [] choices = {"Randrom", "White","Black"};
        final JComboBox combo = new JComboBox(choices);
        combo.setMaximumRowCount(3);
        add(combo);
        JLabel Player2 = new JLabel("Player 2");
        add(Player2);
        
        String [] pChoice = new String[2]; // pChoice[0] -> Player1, pChoice[1] -> Player2.
        combo.addItemListener(
                new ItemListener(){
            public void itemStateChanged(ItemEvent event) {
                /**
                 * TODO tha "kali" ton constractora tis class playersChoice kai tha dini san isodo
                 * to clr: ton arhiko haraktira tou hromatos pou epilexe o Player1
                 * kai to name: pou ine ena 1D String me ta onomata ton Piece.
                 */
                
            }
                    
                }
        );
    }
    
    /**
     * TODO na boun ta buttons "Exit" kai "Play".
     */
}